home *** CD-ROM | disk | FTP | other *** search
/ Homo Sapiens / Home Sapiens.iso / setup / hsboth.mst < prev    next >
Encoding:
Text File  |  1995-03-20  |  18.1 KB  |  557 lines

  1. '**************************************************************************
  2. '*                 Homo Sapiens - v.1.00
  3. '**************************************************************************
  4.  
  5. ''$DEFINE DEBUG
  6.  
  7. '$INCLUDE 'setupapi.inc'
  8. '$INCLUDE 'mscpydis.inc'    ''System
  9. '$INCLUDE 'msdetect.inc'    ''Detects Avalilable Disk Space
  10.  
  11. DECLARE FUNCTION mciSendString LIB "mmsystem.dll" (szCommand AS STRING, szReturn AS STRING, wRetunL AS INTEGER, hVoid AS INTEGER ) AS LONG
  12.  
  13. ''Dialog ID's
  14. CONST WELCOME       = 100
  15. CONST ASKQUIT       = 200
  16. CONST DESTPATH      = 300
  17. CONST EXITFAILURE   = 400
  18. CONST EXITQUIT      = 600
  19. CONST EXITSUCCESS   = 700
  20. CONST APPHELP       = 900
  21. CONST BADPATH       = 6400
  22. CONST CHECK         = 2500
  23. CONST SMALLWIN      = 2200
  24. CONST RESTART       = 2600
  25. CONST RESTARTII     = 2700
  26. CONST UPDATERUNTIME = 9000
  27. CONST DISKSPACEDLG  = 8050
  28. ''Bitmap ID
  29. CONST LOGO = 1
  30. CONST VFW11 = 2
  31.  
  32. GLOBAL DEST$        ''Default destination directory.
  33. GLOBAL INSTPATH$    ''Default destination directory.
  34. GLOBAL RET$
  35. GLOBAL CUIDLL$
  36.  
  37. DECLARE SUB InstallHS
  38. DECLARE SUB ConfigHS
  39. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  40. DECLARE FUNCTION EnoughDiskSpace () AS INTEGER
  41.  
  42. GLOBAL SizeReq&  '' Total Disk Size required for installation
  43.  
  44. ''''''''''''''''''''''''''''''
  45. ''VFW11
  46. ''File Types
  47. GLOBAL WinDir$
  48. GLOBAL WinSysDir$
  49. GLOBAL WinSys32Dir$
  50. GLOBAL WINDRIVE$    ''Windows Drive Letter.
  51. GLOBAL CHECKSTATES$
  52. GLOBAL MinorVer%
  53. GLOBAL OnNT$
  54.  
  55. DECLARE SUB Install
  56. DECLARE FUNCTION OnWindowsNT LIB "INIUPD.DLL" AS INTEGER
  57. DECLARE FUNCTION VflatdPresent LIB "iniupd.DLL" AS INTEGER
  58. DECLARE SUB Reboot LIB "iniupd.dll"
  59. DECLARE FUNCTION ExitWindowsExec  LIB "User" (Exec$, Param$) AS INTEGER
  60.  
  61.  
  62. INIT:
  63.     SetTitle "Homo Sapiens - Set Up"
  64.  
  65.     CUIDLL$ = "mscuihe.dll"            ''Custom user interface dll - inglese
  66.     CUIVFWDLL$ = "mscuistf.dll"         ''Custom user interface dll
  67.     HELPPROC$ = "FHelpDlgProc"          ''Help dialog procedure
  68.  
  69.     WIN32ENABLED% = 0
  70.     MajorVer% = GetWindowsMajorVersion()
  71.     MinorVer% = GetWindowsMinorVersion()
  72.     Processor% = GetProcessorType()
  73.  
  74.  
  75.     IF MajorVer% < 3 OR (MajorVer% = 3 AND MinorVer% < 10) THEN
  76.     i% = DoMsgBox("Microsoft Windows version 3.10 or greater is required for this software.  Please upgrade your version of Windows.", "Installation Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  77.     END
  78.     END IF
  79.  
  80.     'Prevents installation on 286
  81.     IF Processor% < 3 THEN
  82.     i% = DoMsgBox("Video for Windows requires a 386 or greater processor or emulator.", "Installation Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  83.     END
  84.     END IF
  85.  
  86.     SetBitmap CUIDLL$, LOGO
  87.  
  88.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  89.     IF szInf$ = "" THEN
  90.     szInf$ = GetSymbolValue("STF_CWDDIR") + "HS.INF"
  91.     END IF
  92.     ReadInfFile szInf$
  93.  
  94.     WinDir$ = GetWindowsDir()
  95.     WinSysDir$ = GetWindowsSysDir()
  96.     RET$ = "                                                    "
  97.     WINDRIVE$ = MID$(GetWindowsDir, 1, 1)
  98.     DEST$ = GetIniKeyString( MakePath(WinDir$, "OPERAMM.INI"), "Homo Sapiens", "InstallationPath" )
  99.     IF DEST$ = "" THEN
  100.         DEST$ = "C:\HOMO"
  101.     END IF
  102.  
  103. '$IFDEF DEBUG
  104.     i% = SetSizeCheckMode(scmOnIgnore)    '' could use scmOff; def = scmOnFatal
  105.     WinDrive$ = MID$(GetWindowsDir, 1, 1)
  106.     IF IsDriveValid(WinDrive$) = 0 THEN
  107.     i% = DoMsgBox("Windows drive ('"+WinDrive$+"') is not a valid drive.", "DEBUG", MB_TASKMODAL+MB_ICONHAND+MB_OK)
  108.     GOTO QUIT
  109.     END IF
  110. '$ENDIF ''DEBUG
  111.  
  112.  
  113. LANGUAGE:
  114.     sz$ = UIStartDlg(CUIDLL$, LANGUAGE, "FInfoDlgProc", 0, "")
  115.     IF sz$ = "ITALIANO" THEN
  116.     CUIDLL$ = "mscuihs.dll"            ''Custom user interface dll - italiano
  117.     ELSE
  118.     CUIDLL$ = "mscuihe.dll"            ''Custom user interface dll - inglese
  119.     END IF
  120.  
  121. WELCOME:
  122.     sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", APPHELP, HELPPROC$)
  123.     IF sz$ = "CONTINUE" THEN
  124.     UIPop 1
  125.     ELSE
  126.     GOSUB ASKQUIT
  127.     GOTO WELCOME
  128.     END IF
  129.  
  130. GETPATH:
  131.     SetSymbolValue "EditTextIn", DEST$
  132.     SetSymbolValue "EditFocus", "END"
  133. GETPATHL1:
  134.     sz$ = UIStartDlg(CUIDLL$, DESTPATH, "FEditDlgProc", APPHELP, HELPPROC$)
  135.     DEST$ = GetSymbolValue("EditTextOut")
  136.  
  137.     IF sz$ = "CONTINUE" THEN
  138.     IF IsDirWritable(DEST$) = 0 THEN
  139.         GOSUB BADPATH
  140.         GOTO GETPATHL1
  141.     END IF
  142.     rr% = EnoughDiskSpace ()
  143.     IF rr% <> 0 THEN
  144.         IF rr% = 3 THEN
  145.             GOSUB ASKQUIT
  146.             GOTO GETPATH
  147.         END IF
  148.         GOTO GETPATHL1
  149.     END IF
  150.     UIPop 1
  151.     ELSEIF sz$ = "REACTIVATE" THEN
  152.     GOTO GETPATHL1
  153.     ELSEIF sz$ = "BACK" THEN
  154.     UIPop 1
  155.     GOTO WELCOME
  156.     ELSE
  157.     GOSUB ASKQUIT
  158.     GOTO GETPATH
  159.     END IF
  160.  
  161.  
  162.     CreateDir DEST$, cmoNone
  163.     OpenLogFile MakePath(DEST$, "LOGFILE.OUT"), 0
  164.     InstallHS
  165.  
  166.     AVI = 0
  167.     e& = mciSendString ( "sysInfo all quantity", RET$, 30, 0 )
  168.     IF e& = 0 THEN
  169.         NumDev% = VAL(RET$)
  170.         FOR dev% = 1 to NumDev%
  171.             e& = mciSendString ( "sysInfo all name "+STR$(dev%), RET$, 40, 0 )
  172.             IF RET$ = "AVIVideo" THEN
  173.                 AVI = 1
  174.             END IF
  175.         NEXT
  176.     END IF
  177.     IF AVI <> 0 THEN
  178. UPDRUNTIME:
  179.         sz$ = UIStartDlg(CUIDLL$, UPDATERUNTIME, "FQuitDlgProc", 0, "")
  180.  
  181.         IF sz$ = "EXIT" THEN
  182.         UIPop 1
  183.             GOTO ENDOFSETUP
  184.         ELSEIF sz$ = "REACTIVATE" THEN
  185.         GOTO UPDRUNTIME
  186.         ELSE
  187.         UIPop 1
  188.         END IF
  189.     END IF
  190.  
  191.  
  192. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  193. '' Video For Windows 1.1 installation
  194.  
  195. ''Prepare Copy list and check size
  196.  
  197.     ClearCopyList
  198.     SrcDir$ = GetSymbolValue("STF_SRCDIR")
  199.     DEST$ = WinDir$
  200.     WinSys32Dir$ = WinDir$ + "system32"
  201.  
  202.     ' Use Wowexec to determine version of NT.  3.1 did not stamp wowexec and wow returns 3.1 as version
  203.     IF OnWindowsNT() THEN
  204.       OnNT$ = "TRUE"
  205.       WowVersion$ = GetVersionOfFile(WinSys32Dir$ + "\wowexec.exe")
  206.       IF WowVersion$ = "" THEN
  207.          i% = DoMsgBox("Video for Windows does not run on Windows NT 3.1.  Please upgrade your version of Windows.", "Installation Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  208.          GOTO ENDOFSETUP
  209.       END IF
  210.     END IF
  211.  
  212. ''  Runtime files (on Windows disk)
  213. ''  Do not install OLE or MPlayer if on next release of NT or Windows
  214.  
  215.     IF ((NOT OnNT$ = "TRUE") AND MinorVer% < 50) THEN           'These files not necessary on Windows NT
  216.     AddSectionFilesToCopyList "MPlayer", SrcDir$, WinDir$
  217.     AddSectionFilesToCopyList "OLE2", SrcDir$, WinSysDir$
  218.     END IF
  219.     AddSectionFilesToCopyList "VfW Runtime", SrcDir$, WinSysDir$
  220.     AddSectionFilesToCopyList "ACM Drivers", SrcDir$, WinSysDir$
  221.     AddSectionFilesToCopyList "AVICodecs", SrcDir$, WinSysDir$
  222.     IF OnNT$ = "TRUE" THEN
  223.     AddSectionFilesToCopyList "NT MSVideo", SrcDir$, WinSys32Dir$
  224.     ENDIF
  225. ''*************************************************************************************************************************
  226. ''*************************************************************************************************************************
  227. ''To add a DCI provider, please un-comment the AddSectionFilesToCopyList,
  228. ''and add a "DCI Provider" section with to the SETUP.INF file.
  229. ''
  230. ''  AddSectionFilesToCopyList "DCI Provider", SrcDir$, WinSysDir$
  231. ''*************************************************************************************************************************
  232. ''*************************************************************************************************************************
  233.  
  234.  
  235. ''  Check windrive diskspace
  236.     SizeReq& = GetCopyListCost ("","", "")
  237.     IF SizeReq& <> 0 THEN
  238.     GOSUB SMALLWIN
  239.     END
  240.     END IF
  241.  
  242. Install
  243. ConfigHS
  244. CloseLogFile
  245.  
  246. '' Restart Windows: if it has to updates ACM from DOS, it restarts Windows automatically
  247. '' else, it gives the user the choice
  248.     RESTRT% = RestartListEmpty ()
  249.     Exe$ = DEST$ + "\_msrstrt.exe"
  250.     Batch$ = DEST$ + "\_mssetup.bat"
  251.     empty$ = ""
  252. RESTART:
  253.     IF RESTRT% = 0 THEN
  254.        sz$ = UIStartDlg(cuivfwdll$, RESTART, "FInfo0DlgProc", 0, "")
  255.        IF sz$ = "REACTIVATE" THEN
  256.       GOTO RESTART
  257.        ENDIF
  258.        I% = ExitExecRestart ()
  259.        RemoveFile Exe$, cmoForce
  260.        RemoveFile Batch$, cmoForce
  261.        END
  262.     ELSE
  263.        sz$ = UIStartDlg(CUIVFWDLL$, RESTARTII, "FQuitDlgProc", 0, "")
  264.        IF sz$ = "CONTINUE" THEN
  265.       I% = ExitWindowsExec (Exe$, empty$)
  266.       IF I% = 0 THEN
  267.          GOTO RESTART
  268.       ELSE
  269.          END
  270.      ENDIF
  271.        ELSEIF sz$ = "EXIT" THEN
  272.       UIPopAll
  273.       END
  274.        ELSEIF sz$ = "REACTIVATE" THEN
  275.       GOTO RESTART
  276.        ELSE
  277.       UIPop 1
  278.        END IF
  279.     END IF
  280.  
  281. ENDOFSETUP:
  282.     ConfigHS
  283.     CloseLogFile
  284.  
  285. QUIT:
  286.     ON ERROR GOTO ERRQUIT
  287.  
  288.     IF ERR = 0 THEN
  289.     dlg% = EXITSUCCESS
  290.     ELSEIF ERR = STFQUIT THEN
  291.     dlg% = EXITQUIT
  292.     ELSE
  293.     dlg% = EXITFAILURE
  294.     END IF
  295. QUITL1:
  296.     sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
  297.     IF sz$ = "REACTIVATE" THEN
  298.     GOTO QUITL1
  299.     END IF
  300.     UIPop 1
  301.  
  302.     END
  303.  
  304. ERRQUIT:
  305.     i% = DoMsgBox("Unrecoverable error during setup", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  306.     END
  307.  
  308.  
  309.  
  310. BADPATH:
  311.     sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfo0DlgProc", 0, "")
  312.     IF sz$ = "REACTIVATE" THEN
  313.     GOTO BADPATH
  314.     END IF
  315.     UIPop 1
  316.     RETURN
  317.  
  318. ASKQUIT:
  319.     sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
  320.  
  321.     IF sz$ = "EXIT" THEN
  322.     UIPopAll
  323.     ERROR STFQUIT
  324.     ELSEIF sz$ = "REACTIVATE" THEN
  325.     GOTO ASKQUIT
  326.     ELSE
  327.     UIPop 1
  328.     END IF
  329.     RETURN
  330.  
  331.  
  332. SMALLWIN:
  333.     sz$ = UIStartDlg(CUIVFWDLL$, SMALLWIN, "FInfo0DlgProc", 0, "")
  334.     IF sz$ = "REACTIVATE" THEN
  335.     GOTO SMALLWIN
  336.     END IF
  337.     UIPop 1
  338.     RETURN
  339.  
  340.  
  341. '**
  342. '** Purpose:
  343. '**     Builds the copy list and performs all installation operations.
  344. '** Arguments:
  345. '**     none.
  346. '** Returns:
  347. '**     none.
  348. '*************************************************************************
  349. SUB InstallHS STATIC
  350.  
  351.     SrcDir$ = GetSymbolValue("STF_SRCDIR")
  352.  
  353.     WriteToLogFile ""
  354.     WriteToLogFile "  User chose as destination directory: '" + DEST$ + "'"
  355.     WriteToLogFile ""
  356.     WriteToLogFile "May have had to create the directory: " + DEST$
  357.     WriteToLogFile ""
  358.  
  359.     AddSectionFilesToCopyList "Runtime", SrcDir$, DEST$
  360.     AddSectionFilesToCopyList "HOMO", SrcDir$, DEST$
  361.     CopyFilesInCopyList
  362.  
  363.     ini$ = MakePath(WinDir$, "OPERAMM.INI")
  364.     WriteToLogFile ""
  365.     WriteToLogFile "Update INI file"
  366.     WriteToLogFile ""
  367.     CD$ = MID$(SrcDir$,1,2)
  368.     IF CD$ = "\\" THEN
  369.         i% = 3
  370.         Count% = 0
  371.         WHILE i% <= LEN(SrcDir$) AND Count% < 2
  372.             IF MID$(SrcDir$,i%,1) = "\" THEN
  373.                 Count% = Count% + 1
  374.             END IF
  375.             i% = i% +1
  376.         WEND
  377.         IF Count% = 2 THEN
  378.             i% = i%-1
  379.         END IF
  380.         CD$ = MID$(SrcDir$,1,i%-1)
  381.     END IF
  382.     Desktop$ = "Homo Sapiens"
  383.     Audio$ = CD$ + "\mediaita\"
  384.     CreateIniKeyValue ini$, Desktop$, "CDRomDrive", CD$, cmoOverwrite
  385.     CreateIniKeyValue ini$, Desktop$, "PathAudio", Audio$, cmoOverwrite
  386.     CreateIniKeyValue ini$, Desktop$, "InstallationPath", DEST$, cmoOverwrite
  387.     CreateIniKeyValue ini$, Desktop$, "SuoniAmbiente", "SI", cmoOverwrite
  388.     CreateIniKeyValue ini$, Desktop$, "ProgName", "HOMO.EXE", cmoOverwrite
  389.     CreateIniKeyValue ini$, Desktop$, "Sigla", "UNA", cmoOverwrite
  390.  
  391.     INSTPATH$ = DEST$
  392. END SUB
  393.  
  394. SUB ConfigHS STATIC
  395.     CreateProgmanGroup "Opera Multimedia", "", cmoNone
  396.     CreateProgmanItem "Opera Multimedia", "Homo Sapiens", MakePath(INSTPATH$,"Operamm.exe Homo Sapiens"), MakePath(INSTPATH$,"HSINI.exe")+"", cmoOverwrite
  397. '**    CreateProgmanItem "Opera Multimedia", "Homo Sapiens", MakePath(INSTPATH$,"Operamm.exe Homo Sapiens"), MakePath(INSTPATH$,"HSINI.exe")+",,,,"+INSTPATH$, cmoOverwrite
  398. END SUB
  399.  
  400.  
  401. '**
  402. '** Purpose:
  403. '**     Performs all installation operations.
  404. '** Arguments:
  405. '**     none.
  406. '** Returns:
  407. '**     none.
  408. '*************************************************************************
  409. SUB Install STATIC
  410.  
  411.     SetRestartDir WinDir$
  412.     CopyFilesInCopyList
  413.  
  414. ''Updating WIN.INI and SYSTEM.INI
  415. ''Only update SYSTEM.INI  on NT or next version of Windows for other codecs
  416.  
  417. IF ((NOT OnNT$ = "TRUE") AND MinorVer% < 50) THEN
  418.     IF VflatdPresent() = 0 THEN
  419.        CreateSysIniKeyValue WinDir$ + "system.ini", "386Enh", "device", "dva.386", cmoOverwrite
  420.     END IF
  421. END IF
  422.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.IV32", "ir32.dll", cmoOverwrite
  423.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.IV31", "ir32.dll", cmoOverwrite
  424.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.RT21", "ir21.dll", cmoOverwrite
  425.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.YVU9", "iyvu9.dll", cmoOverwrite
  426.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.CVID", "iccvid.drv", cmoOverwrite
  427.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.MSVC", "msvidc.drv", cmoOverwrite
  428.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.MRLE", "MSRLE.drv", cmoOverwrite
  429.     CreateIniKeyValue WinDir$ + "WIN.INI", "mci extensions", "avi", "AVIVideo", cmoOverwrite
  430.     CreateIniKeyValue WinDir$ + "system.ini", "mci", "AVIVideo", "mciavi.drv", cmoOverwrite
  431.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "WaveMapper", "msacm.drv", cmoOverwrite
  432.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "MSACM.msadpcm", "msadpcm.acm", cmoOverwrite
  433.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "MSACM.imaadpcm", "imaadpcm.acm", cmoOverwrite
  434.     CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "ir21.dll", "Intel Indeo(TM) Video R2.1", cmoOverwrite
  435.     CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "msacm.drv", "Microsoft Sound Mapper V2.00", cmoOverwrite
  436.     CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "msadpcm.acm", "Microsoft ADPCM Codec V2.00", cmoOverwrite
  437.     CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "imaadpcm.acm", "Microsoft IMA ADPCM Codec V2.00", cmoOverwrite
  438.  
  439. ''*************************************************************************************************************************
  440. ''*************************************************************************************************************************
  441. ''To add a DCI provider, please un-comment the UDH line, and un-comment and replace the <provider> with your own file name
  442. ''
  443. ''  CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "DCI", "<provider>", cmoOverwrite
  444. ''  CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "vids.draw", "udh.dll", cmoOverwrite
  445. ''*************************************************************************************************************************
  446. ''*************************************************************************************************************************
  447.  
  448. ''Do not register components not installed with Video for Windows on NT or next version of Windows.
  449. IF ((NOT OnNT$ = "TRUE") AND MinorVer% < 50) THEN
  450.     Run ("regedit.exe /s " + MakePath(WinDir$, "mplayer.reg"))
  451.     Run ("regedit.exe /s " + MakePath(WinSysDir$, "OLE2.reg"))
  452.     Run ("regedit.exe /s " + MakePath(WinSysDir$, "cleanup.reg"))
  453.  
  454. '' Mplayer
  455.     CreateProgmanItem "Accessories", "Media Player", MakePath(WinDir$, "mplayer.exe"), "", cmoOverwrite
  456.  
  457. END IF  ''NT and next version of Windows installation stop here.
  458.  
  459.     Run ("profdisp.exe")   
  460.  
  461. END SUB
  462.  
  463.  
  464. FUNCTION EnoughDiskSpace() STATIC AS INTEGER
  465.  
  466.     EnoughDiskSpace = 0
  467.  
  468.     SrcDir$ = GetSymbolValue("STF_SRCDIR")
  469.     SetSymbolValue "Extra", ""
  470.     SetSymbolValue "Cost", ""
  471.     
  472.     DESTDRIVE$ = MID$(DEST$,1,1)
  473.     
  474.     win% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
  475.     inst% = ASC(ucase$(DESTDRIVE$)) - ASC("A") + 1
  476.     FOR i% = 1 TO (win%-1)
  477.         rr% = FAddListItem ("Extra", "0")
  478.     NEXT i%
  479.     rr% = FAddListItem ("Extra", "10000")
  480.     ClearCopyList
  481.     AddSectionFilesToCopyList "Runtime", SrcDir$, DEST$
  482.     AddSectionFilesToCopyList "HOMO", SrcDir$, DEST$
  483.     StillNeed& = GetCopyListCost("Extra", "Cost", "")
  484.  
  485.     IF StillNeed& > 0 THEN
  486.         cost& = VAL(GetListItem("Cost", win%))
  487.         free& = GetFreeSpaceForDrive(WINDRIVE$)
  488.  
  489.         EnoughDiskSpace = 1
  490.         IF cost& > free& THEN
  491.             FullName$ = "Disco di Windows:"
  492.             FullDrive$ = WINDRIVE$ + ":"
  493.             GOSUB DISKSPACE
  494.         END IF
  495.  
  496.         'Se scelgo Esci, viene resettato questo long, quindi non continuo
  497.         IF StillNeed& > 0 THEN
  498.             cost& = VAL(GetListItem("Cost", inst%))
  499.             free& = GetFreeSpaceForDrive(DESTDRIVE$)
  500.     
  501.             IF cost& > free& THEN
  502.                 FullName$ = "Disco di installazione:"
  503.                 FullDrive$ = DESTDRIVE$ + ":"
  504.                 GOSUB DISKSPACE
  505.             END IF
  506.         END IF
  507.     END IF
  508.     GOTO FINESUB
  509.  
  510. DISKSPACE:
  511.     SetSymbolValue "ConfirmTextIn", ""
  512.     rr% = FAddListItem ("ConfirmTextIn", FullName$)
  513.     rr% = FAddListItem ("ConfirmTextIn", FullDrive$)
  514.     rr% = FAddListItem ("ConfirmTextIn", "Spazio richiesto:")
  515.     rr% = FAddListItem ("ConfirmTextIn", STR$(cost&/1024)+" KB")
  516.     rr% = FAddListItem ("ConfirmTextIn", "Spazio disponibile:")
  517.     rr% = FAddListItem ("ConfirmTextIn", STR$(free&/1024)+" KB")
  518. DISKSPACE1:
  519.     sz$ = UIStartDlg(CUIDLL$, DISKSPACEDLG, "FConfirmDlgProc", APPHELP, HELPPROC$)
  520.  
  521.     IF sz$ = "CONTINUE" THEN
  522.         UIPop 1
  523.     ELSEIF sz$ = "REACTIVATE" THEN
  524.         GOTO DISKSPACE1
  525.     ELSE
  526.         UIPop 1
  527.         EnoughDiskSpace = 3
  528.         StillNeed& = 0
  529.     END IF
  530.     RETURN
  531.  
  532. FINESUB:
  533.     ClearCopyList
  534. END FUNCTION
  535. '**
  536. '** Purpose:
  537. '**     Appends a file name to the end of a directory path,
  538. '**     inserting a backslash character as needed.
  539. '** Arguments:
  540. '**     szDir$  - full directory path (with optional ending "\")
  541. '**     szFile$ - filename to append to directory
  542. '** Returns:
  543. '**     Resulting fully qualified path name.
  544. '*************************************************************************
  545. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  546.     IF szDir$ = "" THEN
  547.     MakePath = szFile$
  548.     ELSEIF szFile$ = "" THEN
  549.     MakePath = szDir$
  550.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  551.     MakePath = szDir$ + szFile$
  552.     ELSE
  553.     MakePath = szDir$ + "\" + szFile$
  554.     END IF
  555. END FUNCTION
  556.  
  557.